Repository navigation
Apply entity styles when rendering to a SolidModel - #369
Merged
Merged
Conversation
to_primitives(::SolidModel, ::StyledEntity) rendered the unstyled entity, so any style without a SolidModel method of its own was silently dropped: Rounded on GmshNative, StyleDict on a single polygon, and user-defined styles. Apply such styles through to_polygons, as rendering to a Cell does, warning once per type on OpenCascade when that discretizes curves. Plain, MeshSized and WithDirection still pass through, keeping native curves, and ToTolerance renders its entity with its atol. Rounded on OpenCascade re-wrapped an ellipse in the style and recursed until the stack overflowed; ellipses now come back exact. StyleDict on an entity without a contour tree, such as a Rectangle or path node, applies its style at [1] in 2D and in SolidModels, instead of recursing, and throws an ArgumentError for styles at other indices. The GeometryEntityStyle docstring says how to keep curves for a custom style on OpenCascade.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rendering a
StyledEntityto aSolidModelsilently dropped any style that didn't have its own SolidModel method. For example,Roundeddidn't round on theGmshNativekernel,StyleDict(Rounded(…))on a plain polygon didn't round on either kernel, and a custom style implemented throughto_polygonsrendered in aCellbut was ignored in aSolidModel. Separately,Roundedon an ellipse or circle on OpenCascade recursed until the stack overflowed, and so didto_polygonswith aStyleDicton a single polygon such as aRectangle.Now:
to_polygons, as inCellrendering. On OpenCascade this discretizes curves, so it warns once per type.Plain,MeshSizedandWithDirectionstill pass through, so native curves survive.ToTolerancerenders its entity with itsatol.Roundedellipses and circles on OpenCascade stay exact, since they have no corners.StyleDicton an entity other than aClippedPolygonorCurvilinearRegion, such as aRectangleor a path node, applies its style at[1]to the whole entity, in 2D and in SolidModels. Styles at other indices throw anArgumentError, since there are no contours for them to apply to.GeometryEntityStyledocstring says how to keep curves for a custom style on OpenCascade.Tests cover each case on both kernels, nested styles, and a full
render!.